package com.qijian.maindata.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import com.qijian.common.core.domain.BaseEntity;
import com.qijian.common.enums.ApprovalDescriptionEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 库存统计 库存统计对象 sd_inventory
 *
 * @author qijian
 * @date 2024-02-28
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@TableName("sd_inventory")
public class SdInventory extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "id")
    private Long id;

    @Excel(name = "工单id")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "工单id")
    private Long workOrderId;

    @Excel(name = "工序Id")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "工序Id")
    private Long fmProcessId;

    @Excel(name = "工序名称")
    @ApiModelProperty(value = "工序名称")
    private String processName;

    @Excel(name = "工序顺序")
    @ApiModelProperty(value = "工序顺序")
    private Integer fmProcessSort;

    @Excel(name = "库存量")
    @ApiModelProperty(value = "库存量")
    private BigDecimal qty;

    @Excel(name = "库存状态 0:半成品 1:成品")
    @ApiModelProperty(value = "库存状态 0:半成品 1:成品")
    private String status;

    @Excel(name = "物料id")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "物料id")
    private Long itemId;

    @Excel(name = "物料编码")
    @ApiModelProperty(value = "物料编码")
    private String itemCode;

    @Excel(name = "物料名称")
    @ApiModelProperty(value = "物料名称")
    private String itemName;

    @Excel(name = "出库数量")
    @ApiModelProperty(value = "出库数量")
    private BigDecimal outQty;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出库时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "出库时间")
    private Date outDate;

    @Excel(name = "流转卡号")
    @ApiModelProperty(value = "流转卡号")
    private String circulationNo;

    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "${column.columnComment}")
    private Long processId;

    @Excel(name = "已入库数量")
    @ApiModelProperty(value = "已入库数量")
    private BigDecimal intoQty;

    @Excel(name = "内部件号")
    @ApiModelProperty(value = "内部件号")
    private String internalNumber;

    @Excel(name = "来源内部件号")
    @ApiModelProperty(value = "来源内部件号")
    private String internalNumberSource;

    @Excel(name = "是否已经投料")
    @ApiModelProperty(value = "是否已经投料")
    private Boolean isFeed;

    @Excel(name = "库存表id")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "库存表id")
    private Long fmStoreId;

    @Excel(name = "库存名称")
    @ApiModelProperty(value = "库存名称")
    private String storeName;

    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    @ApiModelProperty(value = "${column.columnComment}")
    private String storeLocationName;

    @Excel(name = "备注")
    @ApiModelProperty(value = "备注")
    private String remark;

    private String itemSpec;

    private String itemUnits;

    private String batchNo;

    private String brand;

    private String material;

    @TableField(exist = false)
    private BigDecimal confirmQty;

    @ApiModelProperty(value = "线径")
    private String diameter;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long detailId;

    @ApiModelProperty(value = "炉号")
    private String customerPartNumber;

    @ApiModelProperty(value = "卷件号")
    private String heatNumber;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long constractId;

    private String nfcCarId;

    private Boolean nfcIsUse;

    @ApiModelProperty("生产日期")
    private String produceDate;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("收料通知单明细ID")
    private Long takeDetailId;

    @ApiModelProperty("生产订单号")
    private String orderNo;

    @ApiModelProperty("完工kg")
    private BigDecimal finishQtyKg;

    @ApiModelProperty("毛重")
    private BigDecimal roughWeight;
    @ApiModelProperty("桶号")
    private String barrelNumber;
    @ApiModelProperty("金蝶材质")
    private String kdMaterial;
    @ApiModelProperty("已经质检")
    private Boolean isInspected;

    @ApiModelProperty("是否委外")
    private Boolean isOut;

    /**
     * 审核者
     */
    @ApiModelProperty(value = "审核者")
    private String approvalBy;

    /**
     * 审核时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "审核时间")
    private Date approvalTime;

    /**
     * 审核状态
     */
    @ApiModelProperty(value = "审核状态")
    private ApprovalDescriptionEnum approvalStatus;


}
